package com.yanqu.road.logic.bussiness.marriage;

import com.yanqu.road.logic.bussiness.DaoHelper;
import com.yanqu.road.entity.marriage.MarriageInfo;
import com.yanqu.road.entity.marriage.MarriageRecord;
import com.yanqu.road.entity.player.UserMarriageData;

import java.util.LinkedList;
import java.util.Map;

public class MarriageBusiness {

    public static Map<Long, Map<String, MarriageInfo>> getMarriageInfoMap(long serverId) {
        return DaoHelper.getMarriageDaoImpl().getMarriageInfoMap(serverId);
    }

    public static LinkedList<MarriageInfo> getLonelyMarriageInfoList(long userId, int maxCount) {
        return DaoHelper.getMarriageDaoImpl().getLonelyMarriageInfoList(userId, maxCount);
    }

    public static boolean addMarriageInfo(MarriageInfo info) {
        return DaoHelper.getMarriageDaoImpl().add(info);
    }

    public static boolean updateMarriageInfo(MarriageInfo info) {
        return DaoHelper.getMarriageDaoImpl().update(info);
    }

    public static Map<Long, UserMarriageData> getUserMarriageDataMap() {
        return DaoHelper.getUserMarriageDaoImpl().getUserMarriageDataMap();
    }

    public static UserMarriageData getUserMarriageData(long userId) {
        return DaoHelper.getUserMarriageDaoImpl().getUserMarriageData(userId);
    }

    public static boolean addUserMarriageData(UserMarriageData userMarriageData) {
        return DaoHelper.getUserMarriageDaoImpl().add(userMarriageData);
    }

    public static boolean updateUserMarriageData(UserMarriageData userMarriageData) {
        return DaoHelper.getUserMarriageDaoImpl().update(userMarriageData);
    }

    public static boolean addOfflineMarriageTimes(long userId) {
        return DaoHelper.getUserMarriageDaoImpl().addOfflineMarriageTimes(userId);
    }

    public static LinkedList<MarriageRecord> getMarriageRecordList(long userId, int maxCount) {
        return DaoHelper.getMarriageRecordDaoImpl().getMarriageRecordList(userId, maxCount);
    }

    public static boolean addMarriageRecord(MarriageRecord marriageRecord) {
        return DaoHelper.getMarriageRecordDaoImpl().add(marriageRecord);
    }

    public static boolean updateMarriageRecord(MarriageRecord marriageRecord) {
        return DaoHelper.getMarriageRecordDaoImpl().update(marriageRecord);
    }

    public static MarriageInfo getMarriageInfoByChildId(long serverId,long userId,String childUid) {
        return DaoHelper.getMarriageDaoImpl().getMarriageInfoByChildId(serverId,userId,childUid);
    }

    @Deprecated
    public static Map<String, MarriageRecord> getCanMarriageRecord(long userId) {
        return DaoHelper.getMarriageRecordDaoImpl().getCanMarriageRecord(userId);
    }

    public static Map<String, MarriageRecord> getCanMarriageRecordNew(long userId, long occupation, int limit) {
        return DaoHelper.getMarriageRecordDaoImpl().getCanMarriageRecordNew(userId, occupation, limit);
    }

    public static Map<String, MarriageRecord> getCanMarriageRecordNew(long userId, int limit) {
        return DaoHelper.getMarriageRecordDaoImpl().getCanMarriageRecordNew(userId, limit);
    }

    public static long getCanMarriageRecordCount(long userId) {
        return DaoHelper.getMarriageRecordDaoImpl().getCanMarriageRecordCount(userId);
    }
}
